// @ts-check
import { defineStore, acceptHMRUpdate } from 'pinia'

export const useProjectStore = defineStore({
  id: 'project',
  state: () => ({
    id: sessionStorage.getItem('PROJECT_ID') || null,
    list: {}
  }),
  actions: {
    setId(val: any) {
      this.id = val
      sessionStorage.setItem('PROJECT_ID', val)
    },
    setList(val: any) {
      this.list = Object.assign({}, val)
    }
  },
})

if (import.meta.hot) {
  import.meta.hot.accept(acceptHMRUpdate(useProjectStore, import.meta.hot))
}
